<script type="text/javascript">
	function initialize() {

		<?foreach($this->monit AS $key => $posicao):?>
			var myLatlng<?=$key?> = new google.maps.LatLng(<?=$posicao['lat']?>,<?=$posicao['log']?>);			
		<?endforeach;?>
		
	 	var myOptions = {
	    	zoom: 13,
	    	center: myLatlng0,
	    	mapTypeId: google.maps.MapTypeId.ROADMAP
	  	}
	  	var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

	    /*MARKERS*/
	    <?foreach($this->monit AS $key => $posicao):?>
	  	var marker = new google.maps.Marker({
	      	position: myLatlng<?=$key?>, 
	      	map: map, 
	      	title:"<?=++$key?>!"
		});
	  	<?endforeach;?>
	  	
		/*POLILINHAS*/
	  	var flightPlanCoordinates = [
			<?foreach($this->monit AS $key => $posicao):?>
  	    	new google.maps.LatLng(<?=$posicao['lat']?>,<?=$posicao['log']?>),
  	    	<?endforeach;?>
  	    ];
  	    var flightPath = new google.maps.Polyline({
  	    	path: flightPlanCoordinates,
  	    	strokeColor: "#00F",
  	   		strokeOpacity: 0.5,
  	    	strokeWeight: 2
  	    });

  	    flightPath.setMap(map);
	}

	$(document).ready(function(){
		initialize();
	});
</script>

<h1>Resultado da Pesquisa</h1>
<br><br>

<div id="map_canvas" style="width:760px; height:400px"></div>
<br><br>
<div class="obs_maps">
	Obs: Os seguintes ícones 
	<img class="marker_google" src="/planart/public/imgs/marker.png" />
	são responsaveis para marcar as posisões capturadas.
</div>